package com.sky.context;

import java.time.LocalDateTime;

public class BaseContext {

    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
    public static ThreadLocal<LocalDateTime> threadLocal2 = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void setCurrentTime(LocalDateTime localDateTime) {
        threadLocal2.set(LocalDateTime.now());  // 使用传入的 localDateTime 参数
    }

    public static LocalDateTime getCurrentTime() {
        return threadLocal2.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
